package cn.holy.app.sztxc.record;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Toast;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.bilibili.boxing.BoxingMediaLoader;
import com.bilibili.boxing.loader.IBoxingCallback;
import com.bilibili.boxing.loader.IBoxingMediaLoader;
import com.bumptech.glide.Glide;
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import com.qmuiteam.qmui.widget.QMUITopBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.holy.app.sztxc.R;
import cn.holy.app.sztxc.activity.base.BaseActivity;
import cn.holy.app.sztxc.main.MainActivity;

/**
 * Created by xiong on 18-2-23.
 */

@Route(path = "/app/record")
public class RecordActivity extends BaseActivity implements IBoxingMediaLoader {
    @BindView(R.id.top_bar)
    QMUITopBar topBar;
    @BindView(R.id.content)
    LinearLayout content;
    @BindView(R.id.scrollView)
    ScrollView scrollView;
    private Button rightActionBtn;

    @Override
    protected void initData() {

    }

    @Override
    protected void initView() {
        QMUIStatusBarHelper.translucent(this);
        QMUIStatusBarHelper.setStatusBarDarkMode(this);
        topBar.setTitle(R.string.action_record).setTextColor(ContextCompat.getColor(this, R.color.colorWhite));
        topBar.addLeftImageButton(R.mipmap.ic_back, R.id.action_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });

        rightActionBtn = topBar.addRightTextButton(R.string.action_save, R.id.action_save);
        rightActionBtn.setTextColor(ContextCompat.getColor(this,R.color.colorWhite));
        rightActionBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });
        BoxingMediaLoader.getInstance().init(this);
    }

    @Override
    protected void initLayout() {
        setContentView(R.layout.activity_record);
    }

    @Override
    public void displayThumbnail(@NonNull ImageView img, @NonNull String absPath, int width, int height) {
        Glide.with(this).asFile().load(absPath).into(img);
    }

    @Override
    public void displayRaw(@NonNull ImageView img, @NonNull String absPath, int width, int height, IBoxingCallback callback) {
        Glide.with(this).asFile().load(absPath).into(img);
    }
}
